
package jweslley.ProblemSetVolumes.VolumeI;

/**
 * http://icpcres.ecs.baylor.edu/onlinejudge/external/1/136.html
 *
 * @author  Jonhnny Weslley
 * @version 1.00, 19/10/2008
 */
public class UglyNumbers {

	/**
2
3
5

2 2
2 3
2 5

3 3
3 5

5 5

2 2 2
2 2 3
2 2 5
2 3 3
2 3 5
2 5 5

3 3 3
3 3 5
3 5 5

5 5 5

	 */
	public static void main(String[] args) {
		int[] i = {3,6,9,12,15,18,21,24,27,30};
		for (int j : i) {
			System.out.println(rightPad(j) + "->" + j);
		}
	}

	static String rightPad(int l) {
		StringBuilder lt = new StringBuilder(Integer.toString(l, 2));
		while (lt.length() < 8) {
			lt.insert(0, ' ');
		}
		return lt.toString();
	}
}
